#include <string>

#include "WaveInfo.h"

using namespace std;

WaveInfo::WaveInfo(void)
: m_timeOffset(0.0f), m_noRedBirds(0), m_noYellowBirds(0), m_noBoomerangBirds(0)
{
}

WaveInfo::~WaveInfo(void)
{
}

void WaveInfo::parse(XmlNode *node) throw (...)
{
    try
    {
        m_timeOffset = XmlUtils::getFLOAT32("time_offset", node);
        m_noRedBirds = XmlUtils::getINT32("red", node);
        m_noYellowBirds = XmlUtils::getINT32("yellow", node);
        m_noBoomerangBirds = XmlUtils::getINT32("boomerang", node);
    } catch (exception &e)
    {
        string msg = "Parsing wave information failed. ";
        msg.append(e.what());
        throw runtime_error(msg);
    }
}
